const wnd: any = window;

export const HISTORY_BASENAME = wnd.__POWERED_BY_QIANKUN__ ? `/platform-front/` : "/";

export const oneDayMillims = 24 * 60 * 60 * 1000;

export interface IResponse<T = any> {
  code: number;
  message?: string;
  isAxiosError?: boolean;
  data?: T;
}

export interface IPageResponse<T> extends IResponse<T[]> {
  pageInfo: IPageInfo;
}

export interface IPageInfo {
  page: number;
  size: number;
  total: number;
  pages: number;
}

export interface IMenuItem {
  name?: string;
  key: string;
  show?: boolean;
  type?: number;
  label?: string;
  content?: JSX.Element | string;
  render?: (params: any) => JSX.Element;
}

export interface IBtn {
  icon?: string;
  name: string;
  group?: number[];
  show?: boolean;
  key?: string;
  className?: string;
  onClick: (...args: any) => any;
  title?: string;
  disable?: boolean;
}

export type btnFunc = () => IBtn[];
